/*
 * @Author: your name
 * @Date: 2022-03-19 18:29:03
 * @LastEditTime: 2022-04-18 22:20:27
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \react-antd-admin\vue-admin-template\src\api\category.js
 */
import request from '@/utils/request'

// 获取所有栏目
export function getAllCategory(data) {
  return request({
    url: '/category/findAllCategories',
    method: 'get',
    params: data
  })
}

// 获取所有栏目
export function findCategoryTree() {
  return request({
    url: '/category/findCategoryTree',
    method: 'get',
  })
}

// 删除
export function deleteById(data) {
  return request({
    url: '/category/deleteCategoryById',
    method: 'delete',
    data,
  })
}

// 修改
export function updateById(data) {
  return request({
    url: '/category/updateCategoryById',
    method: 'post',
    data
  })
}

// 添加
export function create(data) {
  return request({
    url: '/category/createCategory',
    method: 'post',
    data,
  })
}